import torch.optim as optim

class Trainer:
    def __init__(self, model, device="cuda"):
        self.model = model.to(device)
        self.optimizer = optim.Adam(model.parameters())

    def train(self, dataloader, epochs=10):
        for epoch in range(epochs):
            for batch in dataloader:
                # 训练逻辑
                pass